<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" th:href="@{/favicon.ico}">
    <link href="https://cdn.bootcdn.net/ajax/libs/bulma/1.0.4/css/bulma.css" rel="stylesheet">
    <title th:replace="${title}">bulma</title>
   
</head>
<body>
<nav class="navbar" th:fragment="navbar">
    <div class="navbar-brand">
        <a class="navbar-item" href="/">
            <img src="/images/logo.png" width="112" height="28">
        </a>
    </div>
    <div class="navbar-menu">
        <div class="navbar-end">
            <a class="navbar-item" href="/">
                首页
            </a>
            <a class="navbar-item" href="/user/dashboard">
                用户中心
            </a>
            <a class="navbar-item" href="/items/add">
                问卷调查
            </a>
        </div>
    </div>
    <div class="navbar-end" sec:authorize="isAuthenticated()">
        <div th:replace="~{::logout-botton}"></div>
    </div>
    <div class="navbar-end" sec:authorize="!isAuthenticated()">
        <div th:replace="~{::auth-bottons}"></div>
    </div>
    <div class="navbar-end" th:fragment="auth-bottons">
        <a class="navbar-item" href="/login">
            登录
        </a>
        <a class="navbar-item" href="/register">
            注册
        </a>
    </div>
    <div class="navbar-end" th:fragment="logout-botton">
        <div class="navbar-item">
            <div>
                欢迎，<span th:text="${#authentication.name}">用户</span>!
            </div>
            <form th:action="@{/logout}" method="post">
                <button class="button is-link is-small">
                    退出登录
                </button>
            </form> 
        </div>
    </div>
    
</nav>
    
<footer class="footer" th:fragment="footer">
    <div class="content has-text-centered">
        <p>
        <strong>我的项目</strong> by 周绪超
        
        </p>
    </div>
</footer>
</body>
</html>